package cn.clx.ymcc.feign;

import cn.clx.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-course",fallbackFactory = CourseFeignBallbackFactory.class)
public interface ICourseUserLearnFeignClient {
    /**
     * 查询是否有权限观看课程
     * @param loginId
     * @param courseId
     * @return
     */
    @RequestMapping(value = "/courseUserLearn/{loginId}/{courseId}",method = RequestMethod.GET)
    JSONResult checkUserPermission(@PathVariable("loginId") Long loginId,@PathVariable("courseId")Long courseId);

    /**
     * 基于id查询课程
     * @param id
     * @return
     */
    @RequestMapping(value = "/course/{id}",method = RequestMethod.GET)
    JSONResult get(@PathVariable("id") Long id);

    /**
     * 获取订单页面课程信息
     * @param ids
     * @return
     */
    @RequestMapping(value = "/course/info/{courseIds}",method = RequestMethod.GET)
    public JSONResult getOrderCourseinfo(@PathVariable("courseIds") String ids);
}
